home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / russell / gc.lha / README < prev    next >
Text File  |  1993-04-26  |  29KB  |  558 lines

  1. Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers
  2. Copyright (c) 1991, 1992 by Xerox Corporation.  All rights reserved.
  3.  
  4. THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
  5. OR IMPLIED.  ANY USE IS AT YOUR OWN RISK.
  6.  
  7. Permission is hereby granted to copy this garbage collector for any purpose,
  8. provided the above notices are retained on all copies.
  9.  
  10.  
  11. This is version 2.6.  Note that functions were renamed since version 1.9
  12. to make naming consistent with PCR collectors.
  13.  
  14. HISTORY -
  15.  
  16.   Early versions of this collector were developed as a part of research
  17. projects supported in part by the National Science Foundation
  18. and the Defense Advance Research Projects Agency.
  19. The SPARC specific code was contributed by Mark Weiser
  20. (weiser@parc.xerox.com).  The Encore Multimax modifications were supplied by
  21. Kevin Kenny (kenny@m.cs.uiuc.edu).  The adaptation to the RT is largely due
  22. to Vernon Lee (scorpion@rice.edu), on machines made available by IBM.
  23. Much of the HP specific code and a number of good suggestions for improving the
  24. generic code are due to Walter Underwood (wunder@hp-ses.sde.hp.com).
  25. Robert Brazile (brazile@diamond.bbn.com) originally supplied the ULTRIX code.
  26. Al Dosser (dosser@src.dec.com) and Regis Cridlig (Regis.Cridlig@cl.cam.ac.uk)
  27. subsequently provided updates and information on variation between ULTRIX
  28. systems.  Parag Patel (parag@netcom.com) supplied the A/UX code.
  29. Bill Janssen (janssen@parc.xerox.com) supplied the SunOS dynamic loader
  30. specific code. Manuel Serrano (serrano@cornas.inria.fr) supplied linux and
  31. Sony News specific code.
  32.  
  33.   (Blame for misinstallation of those modifications goes to the first author,
  34. however.) Some of the improvements incorporated in this version were
  35. suggested by David Chase, then at Olivetti Research.
  36.  
  37.   Much of the code was rewritten by Hans-J. Boehm at Xerox PARC.
  38.  
  39.   This is intended to be a general purpose, garbage collecting storage
  40. allocator.  The algorithms used are described in:
  41.  
  42. Boehm, H., and M. Weiser, "Garbage Collection in an Uncooperative Environment",
  43. Software Practice & Experience, September 1988, pp. 807-820.
  44.  
  45.   Some of the ideas underlying the collector have previously been explored
  46. by others.  (Doug McIlroy wrote a vaguely similar collector that is part of
  47. version 8 UNIX (tm).)  However none of this work appears to have been widely
  48. disseminated.
  49.  
  50.   This collector includes numerous refinements not described in the above paper.
  51.  
  52.   Rudimentary tools for use of the collector as a leak detector are included.
  53.  
  54.  
  55. GENERAL DESCRIPTION
  56.  
  57.   This is a garbage colecting storage allocator that is intended to be
  58. used as a plug-in replacement for C's malloc.
  59.  
  60.   Since the collector does not require pointers to be tagged, it does not
  61. attempt to ensure that all inaccessible storage is reclaimed.  However,
  62. in our experience, it is typically more successful at reclaiming unused
  63. memory than most C programs using explicit deallocation.  Unlike manually
  64. introduced leaks, the amount of unreclaimed memory typically stays
  65. bounded.
  66.  
  67.   In the following, an "object" is defined to be a region of memory allocated
  68. by the routines described below.  
  69.  
  70.   Any objects not intended to be collected must be pointed to either
  71. from other such accessible objects, or from the registers,
  72. stack, data, or statically allocated bss segments.  Pointers from
  73. the stack or registers may point to anywhere inside an object.
  74. However, it is usually assumed that all pointers originating in the
  75. heap point to the beginning of an object.  (This does
  76. not disallow interior pointers; it simply requires that there must be a
  77. pointer to the beginning of every accessible object, in addition to any
  78. interior pointers.)  There are two facilities for altering this behavior.
  79. The macro ALL_INTERIOR_POINTERS may be defined in gc_private.h to
  80. cause any pointer into an object to retain the object.  A routine
  81. GC_register_displacement is provided to allow for more controlled
  82. interior pointer use in the heap.  Defining ALL_INTERIOR_POINTERS
  83. is somewhat dangerous.  See gc_private.h for details.  The routine
  84. GC_register_displacement is described in gc.h.
  85.  
  86.   Note that pointers inside memory allocated by the standard "malloc" are not
  87. seen by the garbage collector.  Thus objects pointed to only from such a
  88. region may be prematurely deallocated.  It is thus suggested that the
  89. standard "malloc" be used only for memory regions, such as I/O buffers, that
  90. are guaranteed not to contain pointers.  Pointers in C language automatic,
  91. static, or register variables, are correctly recognized.
  92.  
  93.   The collector does not generally know how to find pointers in data
  94. areas that are associated with dynamic libraries.  This is easy to
  95. remedy IF you know how to find those data areas on your operating
  96. system (see GC_add_roots).  Code for doing this under SunOS4.X only is
  97. included (see dynamic_load.c).  (Note that it includes a special version
  98. of dlopen, GC_dlopen, that should be called instead of the standard one.
  99. By default, this is not compiled in, since it requires the -ldl library.)
  100. Note that the garbage collector does not need to be informed of shared
  101. read-only data.  However if the shared library mechanism can introduce
  102. discontiguous data areas that may contain pointers, then the collector does
  103. need to be informed.
  104.  
  105.   Signal processing for most signals is normally deferred during collection,
  106. and during uninterruptible parts of the allocation process.  Unlike
  107. standard ANSI C mallocs, it is intended to be safe to invoke malloc
  108. from a signal handler while another malloc is in progress, provided
  109. the original malloc is not restarted.  (Empirically, many UNIX
  110. applications already asssume this.)  The allocator/collector can
  111. also be configured for thread-safe operation.  (Full signal safety can
  112. also be acheived, but only at the cost of two system calls per malloc,
  113. which is usually unacceptable.)
  114.  
  115. INSTALLATION AND PORTABILITY
  116.  
  117.   As distributed, the macro SILENT is defined at the top of gc_private.h.
  118. In the event of problems, this can be removed to obtain a moderate
  119. amount of descriptive output for each collection.
  120. (The given statistics exhibit a few peculiarities.
  121. Things don't appear to add up for a variety of reasons, most notably
  122. fragmentation losses.  These are probably much more significant for the
  123. contrived program "test.c" than for your application.)
  124.  
  125.   Note that typing "make test" will automatically build the collector
  126. and then run setjmp_test and gctest. Setjmp_test will give you information
  127. about configuring the collector, which is useful primarily if you have
  128. a machine that's not already supported.  Gctest is a somewhat superficial
  129. test of collector functionality.  Failure is indicated by a core dump or
  130. a message to the effect that the collector is broken.  Gctest takes about 
  131. 20 seconds to run on a SPARCstation 2. On a slower machine,
  132. expect it to take a while.  It may use up to 8 MB of memory.  (The
  133. multi-threaded version will use more.)
  134.  
  135.   The Makefile will generate a library gc.a which you should link against.
  136. It is suggested that if you need to replace a piece of the collector
  137. (e.g. GC_mark_roots.c) you simply list your version ahead of gc.a on the
  138. ld command line, rather than replacing the one in gc.a.  (This will
  139. generate numerous warnings under some versions of AIX, but it still
  140. works.)
  141.  
  142.   The collector currently is designed to run essentially unmodified on
  143. the following machines:
  144.  
  145.         Sun 3
  146.         Sun 4 under SunOS 4.X or Solaris2.X
  147.         Vax under 4.3BSD, Ultrix
  148.         Intel 386 or 486 under OS/2 (no threads) or linux.
  149.         Sequent Symmetry  (no concurrency)
  150.         Encore Multimax   (no concurrency)
  151.         MIPS M/120 (and presumably M/2000) (RISC/os 4.0 with BSD libraries)
  152.         IBM PC/RT  (Berkeley UNIX)
  153.         IBM RS/6000
  154.         HP9000/300
  155.         HP9000/700
  156.         DECstations under Ultrix
  157.         SGI workstations under IRIX
  158.         Sony News
  159.         Apple MacIntosh under A/UX
  160.  
  161.   For these machines you should check the beginning of gc.h
  162. to verify that the machine type is correctly defined.  On 
  163. nonSun machines, you may also need to make changes to the
  164. Makefile, as described by comments there.
  165.  
  166.   Dynamic libraries are completely supported only under SunOS4.X
  167. (and even that support is not functional on the last Sun 3 release).
  168. On other machines we recommend that you do one of the following:
  169.  
  170.   1) Add dynamic library support (and send us the code).
  171.   2) Use static versions of the libraries.
  172.   3) Arrange for dynamic libraries to use the standard malloc.
  173.      This is still dangerous if the library stores a pointer to a
  174.      garbage collected object.  But nearly all standard interfaces
  175.      prohibit this, because they deal correctly with pointers
  176.      to stack allocated objects.  (Strtok is an exception.  Don't
  177.      use it.)
  178.  
  179.   In all cases we assume that pointer alignment is consistent with that
  180. enforced by the standard C compilers.  If you use a nonstandard compiler
  181. you may have to adjust the alignment parameters defined in gc_private.h.
  182.  
  183.   A port to a machine that is not byte addressed, or does not use 32 bit
  184. addresses will require a major effort.  (Parts of the code try to anticipate
  185. 64 bit addresses.  Others will need to be rewritten, since different data
  186. structures are needed.)  A port to MSDOS is hopeless, unless you are willing
  187. to assume an 80386 or better, and that only flat 32 bit pointers will ever be
  188. used.
  189.  
  190.   For machines not already mentioned, or for nonstandard compilers, the
  191. following are likely to require change:
  192.  
  193. 1.  The parameters at the top of gc_private.h.
  194.       The parameters that will usually require adjustment are
  195.    STACKBOTTOM,  ALIGNMENT and DATASTART.  Setjmp_test
  196.    prints its guesses of the first two.
  197.       DATASTART should be an expression for computing the
  198.    address of the beginning of the data segment.  This can often be
  199.    &etext.  But some memory management units require that there be
  200.    some unmapped space between the text and the data segment.  Thus
  201.    it may be more complicated.   On UNIX systems, this is rarely
  202.    documented.  But the adb "$m" command may be helpful.  (Note
  203.    that DATASTART will usually be a function of &etext.  Thus a
  204.    single experiment is usually insufficient.)
  205.      STACKBOTTOM is used to initialize GC_stackbottom, which
  206.    should be a sufficient approximation to the coldest stack address.
  207.    On some machines, it is difficult to obtain such a value that is
  208.    valid across a variety of MMUs, OS releases, etc.  A number of
  209.    alternatives exist for using the collector in spite of this.  See the
  210.    discussion in gc_private.h immediately preceding the various
  211.    definitions of STACKBOTTOM.
  212.    
  213. 2.  mach_dep.c.
  214.       The most important routine here is one to mark from registers.
  215.     The distributed file includes a generic hack (based on setjmp) that
  216.     happens to work on many machines, and may work on yours.  Try
  217.     compiling and running setjmp_test.c to see whether it has a chance of
  218.     working.  (This is not correct C, so don't blame your compiler if it
  219.     doesn't work.  Based on limited experience, register window machines
  220.     are likely to cause trouble.  If your version of setjmp claims that
  221.     all accessible variables, including registers, have the value they
  222.     had at the time of the longjmp, it also will not work.  Vanilla 4.2 BSD
  223.     makes such a claim.  SunOS does not.)
  224.       If your compiler does not allow in-line assembly code, or if you prefer
  225.     not to use such a facility, mach_dep.c may be replaced by a .s file
  226.     (as we did for the MIPS machine and the PC/RT).
  227.  
  228. 3.  mark_roots.c.
  229.       These are the top level mark routines that determine which sections
  230.     of memory the collector should mark from.  This is normally not
  231.     architecture specific (aside from the macros defined in gc_private.h and
  232.     referenced here), but it can be programming language and compiler
  233.     specific.  The supplied routine should work for most C compilers
  234.     running under UNIX.  Calls to GC_add_roots may sometimes be used
  235.     for similar effect.
  236.  
  237. 4.  The sigsetmask call does not appear to exist under early system V UNIX.
  238.     It is used by the collector to block and unblock signals at times at
  239.     which an asynchronous allocation inside a signal handler could not
  240.     be tolerated.  Under system V, it is possible to remove these calls,
  241.     provided no storage allocation is done by signal handlers.  The
  242.     alternative is to issue a sequence of system V system calls, one per
  243.     signal that is actually used.  This may be a bit slow.
  244.  
  245.   For a different versions of Berkeley UN*X or different machines using the
  246. Motorola 68000, Vax, SPARC, 80386, NS 32000, PC/RT, or MIPS architecture,
  247. it should frequently suffice to change definitions in gc_private.h.
  248.  
  249.  
  250. THE C INTERFACE TO THE ALLOCATOR
  251.  
  252.   The following routines are intended to be directly called by the user.
  253. Note that usually only GC_malloc is necessary.  GC_clear_roots and GC_add_roots
  254. calls may be required if the collector has to trace from nonstandard places
  255. (e.g. from dynamic library data areas on a machine on which the 
  256. collector doesn't already understand them.)  On some machines, it may
  257. be desirable to set GC_stacktop to a good approximation of the stack base. 
  258. (This enhances code portability on HP PA machines, since there is no
  259. good way for the collector to compute this value.)  Client code may include
  260. "gc.h", which defines all of the following, plus a few others.
  261.  
  262. 1)  GC_malloc(nbytes)
  263.     - allocate an object of size nbytes.  Unlike malloc, the object is
  264.       cleared before being returned to the user.  Gc_malloc will
  265.       invoke the garbage collector when it determines this to be appropriate.
  266.       GC_malloc may return 0 if it is unable to acquire sufficient
  267.       space from the operating system.  This is the most probable
  268.       consequence of running out of space.  Other possible consequences
  269.       are that a function call will fail due to lack of stack space,
  270.       or that the collector will fail in other ways because it cannot
  271.       maintain its internal data structures, or that a crucial system
  272.       process will fail and take down the machine.  Most of these
  273.       possibilities are independent of the malloc implementation.
  274.  
  275. 2)  GC_malloc_atomic(nbytes)
  276.     - allocate an object of size nbytes that is guaranteed not to contain any
  277.       pointers.  The returned object is not guaranteed to be cleeared.
  278.       (Can always be replaced by GC_malloc, but results in faster collection
  279.       times.  The collector will probably run faster if large character
  280.       arrays, etc. are allocated with GC_malloc_atomic than if they are
  281.       statically allocated.)
  282.  
  283. 3)  GC_realloc(object, new_size)
  284.     - change the size of object to be new_size.  Returns a pointer to the
  285.       new object, which may, or may not, be the same as the pointer to
  286.       the old object.  The new object is taken to be atomic iff the old one
  287.       was.  If the new object is composite and larger than the original object,
  288.       then the newly added bytes are cleared (we hope).  This is very likely
  289.       to allocate a new object, unless MERGE_SIZES is defined in gc_private.h.
  290.       Even then, it is likely to recycle the old object only if the object
  291.       is grown in small additive increments (which, we claim, is generally bad
  292.       coding practice.)
  293.  
  294. 4)  GC_free(object)
  295.     - explicitly deallocate an object returned by GC_malloc or
  296.       GC_malloc_atomic.  Not necessary, but can be used to minimize
  297.       collections if performance is critical.
  298.  
  299. 5)  GC_expand_hp(number_of_4K_blocks)
  300.     - Explicitly increase the heap size.  (This is normally done automatically
  301.       if a garbage collection failed to GC_reclaim enough memory.  Explicit
  302.       calls to GC_expand_hp may prevent unnecessarily frequent collections at
  303.       program startup.)
  304.       
  305. 6)  GC_clear_roots()
  306.     - Reset the collectors idea of where static variables containing pointers
  307.       may be located to the empty set of locations.  No statically allocated
  308.       variables will be traced from after this call, unless there are
  309.       intervening GC_add_roots calls.  The collector will still trace from
  310.       registers and the program stack.
  311.       
  312. 7)  GC_add_roots(low_address, high_address_plus_1)
  313.     - Add [low_address, high_address) as an area that may contain root pointers
  314.       and should be traced by the collector.  The static data and bss segments
  315.       are considered by default, and should not be added unless GC_clear_roots
  316.       has been called.  The number of root areas is currently limited to 50.
  317.       This is intended as a way to register data areas for dynamic libraries,
  318.       or to replace the entire data ans bss segments by smaller areas that are
  319.       known to contain all the roots. 
  320.  
  321. 8) Several routines to allow for registration of finalization code.
  322.    User supplied finalization code may be invoked when an object becomes
  323.    unreachable.  To call (*f)(obj, x) when obj becomes inaccessible, use
  324.     GC_register_finalizer(obj, f, x, 0, 0);
  325.    For more sophisticated uses, and for finalization ordering issues,
  326.    see gc.h.
  327.  
  328.   The global variable GC_free_space_divisor may be adjusted up from its
  329. default value of 4 to use less space and more collection time, or down for
  330. the opposite effect.  Setting it to 1 or 0 will effectively disable collections
  331. and cause all allocations to simply grow the heap.
  332.  
  333.   The variable GC_non_gc_bytes, which is normally 0, may be changed to reflect
  334. the amount of memory allocated by the above routines that should not be
  335. considered as a candidate for collection.  Collections are inhibited
  336. if this exceeds a given fraction (currently 3/4) of the total heap size.
  337. The heap is simply expanded instead.  Careless use may, of course, result
  338. in excessive memory consumption.
  339.  
  340.   Some additional tuning is possible through the parameters defined
  341. near the top of gc_private.h.
  342.   
  343.   If only GC_malloc is intended to be used, it might be appropriate to define:
  344.  
  345. #define malloc(n) GC_malloc(n)
  346. #define calloc(m,n) GC_malloc((m)*(n))
  347.  
  348.   For small pieces of VERY allocation intensive code, gc_inline.h
  349. includes some allocation macros that may be used in place of GC_malloc
  350. and friends.
  351.  
  352.   Somewhat different emulations of the standard C allocation routines are
  353. contained and described in "interface.c" (contributed by David Chase, but
  354. subsequently mangled by Hans Boehm).  These are appropriate for mixed
  355. systems, where part of the system uses explicit deallocation, and does not
  356. leak.  Exclusive use of interface.c routines can result in needless
  357. fragmentation, since certain kinds of object coalescing are only done
  358. by the collector.
  359.  
  360.   All externally visible names in the garbage collector start with "GC_".
  361. To avoid name conflicts, client code should avoid this prefix, except when
  362. accessing garbage collector routines or variables.
  363.  
  364.   The internals of the collector understand different object "kinds" (sometimes
  365. called "regions").  By default, the only two kinds are ATOMIC and NORMAL.
  366. Its should be possible to add others, e.g. for data types for which layout
  367. information is known.  The allocation routine "GC_generic_malloc"
  368. takes an explicit kind argument.  (You will probably want to add
  369. faster kind-specific routines as well.) You will need to add another kind
  370. descriptor, including your own mark routine to add a new object kind.
  371. This requires a fairly detailed understanding of at least GC_mark.
  372.  
  373.  
  374. USE AS LEAK DETECTOR:
  375.  
  376.   The collector may be used to track down leaks in C programs that are
  377. intended to run with malloc/free (e.g. code with extreme real-time or
  378. portability constraints).  To do so define FIND_LEAK somewhere in
  379. gc_private.h.  This will cause the collector to invoke the report_leak
  380. routine defined near the top of reclaim.c whenever an inaccessible
  381. object is found that has not been explicitly freed.
  382.   Productive use of this facility normally involves redefining report_leak
  383. to do something more intelligent.  This typically requires annotating
  384. objects with additional information (e.g. creation time stack trace) that
  385. identifies their origin.  Such code is typically not very portable, and is
  386. not included here.
  387.   If all objects are allocated with GC_DEBUG_MALLOC (see next section),
  388. then the default version of report_leak will report the source file
  389. and line number at which the leaked object was allocated.  This may
  390. sometimes be sufficient.
  391.  
  392.  
  393. DEBUGGING FACILITIES:
  394.  
  395.   The routines GC_debug_malloc, GC_debug_malloc_atomic, GC_debug_realloc,
  396. and GC_debug_free provide an alternate interface to the collector, which
  397. provides some help with memory overwrite errors, and the like.
  398. Objects allocated in this way are annotated with additional
  399. information.  Some of this information is checked during garbage
  400. collections, and detected inconsistencies are reported to stderr.
  401.  
  402.   Simple cases of writing past the end of an allocated object should
  403. be caught if the object is explicitly deallocated, or if the
  404. collector is invoked while the object is live.  The first deallocation
  405. of an object will clear the debugging info associated with an
  406. object, so accidentally repeated calls to GC_debug_free will report the
  407. deallocation of an object without debugging information.  Out of
  408. memory errors will be reported to stderr, in addition to returning
  409. NIL.
  410.  
  411.   GC_debug_malloc checking  during garbage collection is enabled
  412. with the first call to GC_debug_malloc.  This will result in some
  413. slowdown during collections.  If frequent heap checks are desired,
  414. this can be acheived by explicitly invoking GC_gcollect, e.g. from
  415. the debugger.
  416.  
  417.   GC_debug_malloc allocated objects should not be passed to GC_realloc
  418. or GC_free, and conversely.  It is however acceptable to allocate only
  419. some objects with GC_debug_malloc, and to use GC_malloc for other objects,
  420. provided the two pools are kept distinct.  In this case, there is a very
  421. low probablility that GC_malloc allocated objects may be misidentified as
  422. having been overwritten.  This should happen with probability at most
  423. one in 2**32.  This probability is zero if GC_debug_malloc is never called.
  424.  
  425.   GC_debug_malloc, GC_malloc_atomic, and GC_debug_realloc take two
  426. additional trailing arguments, a string and an integer.  These are not
  427. interpreted by the allocator.  They are stored in the object (the string is
  428. not copied).  If an error involving the object is detected, they are printed.
  429.  
  430.   The macros GC_MALLOC, GC_MALLOC_ATOMIC, GC_REALLOC, GC_FREE, and
  431. GC_REGISTER_FINALIZER are also provided.  These require the same arguments
  432. as the corresponding (nondebugging) routines.  If gc.h is included
  433. with GC_DEBUG defined, they call the debugging versions of these
  434. functions, passing the current file name and line number as the two
  435. extra arguments, where appropriate.  If gc.h is included without GC_DEBUG
  436. defined, then all these macros will instead be defined to their nondebugging
  437. equivalents.  (GC_REGISTER_FINALIZER is necessary, since pointers to
  438. objects with debugging information are really pointers to a displacement
  439. of 16 bytes form the object beginning, and some translation is necessary
  440. when finalization routines are invoked.  For details, about what's stored
  441. in the header, see the definition of the type oh in debug_malloc.c)
  442.  
  443.  
  444. BUGS:
  445.  
  446.   Any memory that does not have a recognizable pointer to it will be
  447. reclaimed.  Exclusive-or'ing forward and backward links in a list
  448. doesn't cut it.
  449.   Some C optimizers may lose the last undisguised pointer to a memory
  450. object as a consequence of clever optimizations.  This has almost
  451. never been observed in practice.  Send mail to boehm@parc.xerox.com
  452. for suggestions on how to fix your compiler.
  453.   This is not a real-time collector.  In the standard configuration,
  454. percentage of time required for collection should be constant across
  455. heap sizes.  But collection pauses will increase for larger heaps.
  456. (On SPARCstation 2s collection times will be on the order of 300 msecs
  457. per MB of accessible memory that needs to be scanned.  Your mileage
  458. may vary.)  Much better real-time behavior would be possible if we
  459. had a portable way to identify sections of memory that were recently
  460. modified.  Experience with PCR indicates that 100 msec pause times
  461. are probably possible, almost independent of heap size.
  462.  
  463. RECENT VERSIONS:
  464.  
  465.   Version 1.3 and immediately preceding versions contained spurious
  466. assembly language assignments to TMP_SP.  Only the assignment in the PC/RT
  467. code is necessary.  On other machines, with certain compiler options,
  468. the assignments can lead to an unsaved register being overwritten.
  469. Known to cause problems under SunOS 3.5 WITHOUT the -O option.  (With
  470. -O the compiler recognizes it as dead code.  It probably shouldn't,
  471. but that's another story.)
  472.  
  473.   Version 1.4 and earlier versions used compile time determined values
  474. for the stack base.  This no longer works on Sun 3s, since Sun 3/80s use
  475. a different stack base.  We now use a straightforward heuristic on all
  476. machines on which it is known to work (incl. Sun 3s) and compile-time
  477. determined values for the rest.  There should really be library calls
  478. to determine such values.
  479.  
  480.   Version 1.5 and earlier did not ensure 8 byte alignment for objects
  481. allocated on a sparc based machine.
  482.  
  483.   Please address bug reports to boehm@xerox.com.  If you are contemplating
  484. a major addition, you might also send mail to ask whether it's already
  485. been done.
  486.  
  487.   Version 1.8 added ULTRIX support in gc_private.h.
  488.   
  489.   Version 1.9 fixed a major bug in gc_realloc.
  490.   
  491.   Version 2.0 introduced a consistent naming convention for collector
  492. routines and added support for registering dynamic library data segments
  493. in the standard mark_roots.c.  Most of the data structures were revamped.
  494. The treatment of interior pointers was completely changed.  Finalization
  495. was added.  Support for locking was added.  Object kinds were added.
  496. We added a black listing facility to avoid allocating at addresses known
  497. to occur as integers somewhere in the address space.  Much of this
  498. was accomplished by adapting ideas and code from the PCR collector.
  499. The test program was changed and expanded.
  500.  
  501.   Version 2.1 was the first stable version since 1.9, and added support
  502. for PPCR.
  503.  
  504.   Version 2.2 added debugging allocation, and fixed various bugs.  Among them:
  505. - GC_realloc could fail to extend the size of the object for certain large object sizes.
  506. - A blatant subscript range error in GC_printf, which unfortunately
  507.   wasn't excercised on machines with sufficient stack alignment constraints.
  508. - GC_register_displacement did the wrong thing if it was called after
  509.   any allocation had taken place.
  510. - The leak finding code would eventually break after 2048 byte
  511.   byte objects leaked.
  512. - interface.c didn't compile.
  513. - The heap size remained much too small for large stacks.
  514. - The stack clearing code behaved badly for large stacks, and perhaps
  515.   on HP/PA machines.
  516.  
  517.   Version 2.3 added ALL_INTERIOR_POINTERS and fixed the following bugs:
  518. - Missing declaration of etext in the A/UX version.
  519. - Some PCR root-finding problems.
  520. - Blacklisting was not 100% effective, because the plausible future
  521.   heap bounds were being miscalculated.
  522. - GC_realloc didn't handle out-of-memory correctly.
  523. - GC_base could return a nonzero value for addresses inside free blocks.
  524. - test.c wasn't really thread safe, and could erroneously report failure
  525.   in a multithreaded environment.  (The locking primitives need to be
  526.   replaced for other threads packages.)
  527. - GC_CONS was thoroughly broken.
  528. - On a SPARC with dynamic linking, signals stayed diabled while the
  529.   client code was running.
  530.   (Thanks to Manuel Serrano at INRIA for reporting the last two.)
  531.   
  532.   Version 2.4 added GC_free_space_divisor as a tuning knob, added
  533.   support for OS/2 and linux, and fixed the following bugs:
  534. - On machines with unaligned pointers (e.g. Sun 3), every 128th word could
  535.   fail to be considered for marking.
  536. - Dynamic_load.c erroneously added 4 bytes to the length of the data and
  537.   bss sections of the dynamic library.  This could result in a bad memory
  538.   reference if the actual length was a multiple of a page.  (Observed on
  539.   Sun 3.  Can probably also happen on a Sun 4.)
  540.   (Thanks to Robert Brazile for pointing out that the Sun 3 version
  541.   was broken.  Dynamic library handling is still broken on Sun 3s
  542.   under 4.1.1U1, but apparently not 4.1.1.  If you have such a machine,
  543.   use -Bstatic.)
  544.   
  545.   Version 2.5 added Solaris dynamic libary support, Solaris/Intel support,
  546.   and fixed the following bugs:
  547. - Removed an explicit call to exit(1)
  548. - Fixed calls to GC_printf and GC_err_printf, so the correct number of
  549.   arguments are always supplied.  The OS/2 C compiler gets confused if
  550.   the number of actuals and the number of formals differ.  (ANSI C
  551.   doesn't require this to work.  The ANSI sanctioned way of doing things
  552.   causes too many compatibility problems.)
  553.   
  554.   Version 2.6 fixed a bug diagnosed by Al Dosser at DEC.  The marker
  555.   could lose some pointers in the event of a mark stack overflow, a case
  556.   it was intended to handle correctly.  (He also pointed out a performance
  557.   bug that was tickled under the same circumstances.)
  558.